<template>
	<view class="body">
		<view class="account-container">
			<view class="account-title">
				本月收入
			</view>
			
		</view>
		<view class="todayData whiteBg">
			<view class="dsa">
				<view class="dsc">
					<view class="money-title">预估收入</view>
					<view class="whiteBg-text" style="color:#D52631;">¥{{ earnList.monthIncome}}</view>
				</view>
				<view class="dsc">
					<view class="money-title">下单订单数</view>
					<view class="whiteBg-text">{{ earnList.monthOrder}}</view>
				</view>
			</view>
			<!-- <view class="money-title" style="text-align:right;">
				查看详情
			</view> -->
		</view>
		<div >
			<view class="account-container">
				<view class="account-title">
					<!-- {{ item.billing_time_text }} -->
					收入明细
				</view>
				
			</view>
			<view class="todayData whiteBg" v-for="item in earnDetailList" :key="item.id">
				
				<view class="dsb">
					<view class="dscss">
						<view class="money-title2">订单号</view>
						<view class="whiteBg-text2" style="color:#D52631;">{{ item.code}}</view>
					</view>
					<view class="dsc">
						<view class="money-title2">总金额</view>
						<view class="whiteBg-text2">¥{{ item.real_money }}</view>
					</view>
					<view class="dsc">
						<view class="money-title2">预计收入</view>
						<view class="whiteBg-text2">¥{{ item.commission_amount }}</view>
					</view>
				</view>
			</view>
		</div>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				earnDetailList: [],
				earnList: []
			};
		},
		onLoad() {
		// let userinfo = uni.getStorageSync('userinfo');
		// if (userinfo) {
		// 	this.login = true;
		// }
		// this.getUserDetail()
		this.getEarn()
		this.getEarnDetail()
	},
	methods: {
		getEarn() {
			this._post_form('api/ykjp/sell/sell/myIncome', {}, (res) => {
				if (res.code == 1) {
					
					this.earnList = res.data.data
					
				}
			})
		},
		getEarnDetail() {
			this._post_form('api/ykjp/sell/sell/monthIncomeDetails', {}, (res) => {
				if (res.code == 1) {
					
					this.earnDetailList = res.data.data
					
				}
			})
		}
		// getUserDetail() {
		// 	var _this = this;
		// 	_this._post_form('api/user/getUserDetail', {}, function (result) {
		// 		_this.setData({
		// 			userInfo: result.data
		// 		})
		// 	});
		// },
		// gourl(url) {
		// 	if (this.login) {
		// 		uni.navigateTo({
		// 			url: url
		// 		});
		// 	} else {
		// 		uni.navigateTo({
		// 			url: 'login'
		// 		});
		// 	}
		// },
	}
	}
</script>

<style lang="scss">
.money-title2{
	text-align: left;
	color: #9A9A9A;
	font-size: 12px;
	
}
.dscss{
	display: flex;
	flex-direction: column;
}
.whiteBg-text2{
	font-size: 28rpx;
	font-weight: 500;
}
.whiteBg-text{
	font-size: 40rpx;
	font-weight: 500;
}
.whiteBg{
	background-color: #fff;
	border-radius: 20rpx;
	margin-top: 20rpx;
	padding: 20rpx;
}
.account-container{
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 30rpx;
	.account-title{
		font-size: 28rpx;
		font-weight: 600;
		
	}
	.account-more{
		font-size: 26rpx;
		display: flex;
		color: #3D3D3D;

	}
}
.data-container{
	display: flex;
	align-items: center;
	justify-content: space-around;
	padding-bottom: 30rpx;
}
	.body{
		background-color: #F4F5F7;
		padding: 20rpx;
		height: 100vh;
		.money-title{
			text-align: center;
			color: #9A9A9A;
			font-size: 12px;
			span{
				font-size: 40rpx;
				font-weight: 500;
				color: #3D3D3D;

			}
		}
		.money-number{
			font-weight: 500;
			
			color: #FD0001;
			span{
				font-size: 40rpx;
			}
		}
		.sumData{
			background-color: #fff;
			border-radius: 20rpx 20rpx 0 0;
			.sumMoneny{
				display: flex;
				align-items: center;
				justify-content: center;
				flex-direction: column;
				padding: 20rpx;
				
			}
		}
		.promt{
			background-color: #FEEEEF;
			color: #D52631;
			padding: 20rpx;
			border-radius: 0 0 20rpx 20rpx;
			border-radius: 0 0 20rpx 20rpx;
			text{
				font-size: 28rpx;
			}
		}
	}
</style>
